.TH std::ranges::chunk_view::inner-iterator 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ranges::chunk_view::inner-iterator \- std::ranges::chunk_view::inner-iterator

.SH Synopsis
   class /*inner-iterator*/  (since C++23)
                             (exposition only*)

   The return type of chunk_view::outer-iterator::value_type::begin if V models
   input_range.

.SH Member types

   Member type      Definition
   iterator_concept std::input_iterator_tag
   difference_type  ranges::range_difference_t<V>
   value_type       ranges::range_value_t<V>

   Data members

   Member object     Definition
   parent_ (private) A pointer to the "parent object" of type ranges::chunk_view*.
                     (exposition-only member object*)

.SH Member functions

   constructor   constructs an iterator
   (C++23)       \fI(public member function)\fP
   operator=     move assigns another iterator
   (C++23)       \fI(public member function)\fP
   base          returns an iterator to the current element
   (C++23)       \fI(public member function)\fP
   operator*     accesses the element
   (C++23)       \fI(public member function)\fP
   operator++    increments the iterator
   (C++23)       \fI(public member function)\fP

.SH Non-member functions

   operator== compares the iterator with default sentinel
   (C++23)    \fI(function)\fP
   operator-  calculates the remained number of elements
   (C++23)    \fI(function)\fP
   iter_move  casts the result of dereferencing the underlying iterator to its
   (C++23)    associated rvalue reference type
              \fI(function)\fP
   iter_swap  swaps the objects pointed to by two underlying iterators
   (C++23)    \fI(function)\fP

.SH Example


// Run this code

 #include <iostream>
 #include <iterator>
 #include <ranges>
 #include <sstream>

 int main()
 {
     auto letters = std::istringstream{"ABCDEFGHIJK"};

     auto chunks = std::ranges::istream_view<char>(letters)
                 | std::views::chunk(4);

     for (auto chunk : chunks)
     {
         // chunk is an object of type chunk_view::outer_iterator::value_type
         std::cout << '[';
         for (auto inner_iter = chunk.begin(); inner_iter != std::default_sentinel;
              ++inner_iter)
             std::cout << *inner_iter;
         std::cout << "] ";
     }
     std::cout << '\\n';
 }

.SH Output:

 [ABCD] [EFGH] [IJK]

.SH References

     * C++23 standard (ISO/IEC 14882:2023):

     * 26.7.28.5 Class chunk_view::inner-iterator [range.chunk.inner.iter]

.SH See also
